{extends file="../acp.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<link href="__PUBLIC__/Css/front/layer.css?version={$version}" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/Public/Css/acp/AcoContract/contract_list.css?version={$version}"/>
<style type="text/css">
	.layermcont{
		text-align: center;
		overflow:hidden !important;
	}
	.layermchild .layermbtn span{
		color: #333;
	}
	.j_uploadBtn{
		display:block;
		width:120px !important;
		height:25px !important;
		position:absolute;
		top:40px !important;
		left:180px !important;
	}
</style>
{/block}
{block name="content"}
<form id="J_FormArticle" action="" method="post">	
    <div class="formitems inline">
        <label class="fi-name"><span class="colorRed">*</span>企业名称：</label>
        <div class="form-controls">
            <input type="text" placeholder="" class="xlarge" name="company_name" id="company_name"
                   value="{$info.company_name}">
            <span class="fi-help-text hide"></span>
        </div>
    </div>

    <div class="formitems inline">
        <label class="fi-name">
            <span class="colorRed">*</span>所属行业：</label>
        <div class="form-controls">
            <select name="type_id">
                <option value="">--请选择--</option>
                {foreach from=$domain_list item=item}
                <option value="{$item.type_id}" {if $info.type_id == $item.type_id}selected{/if}>{$item.type_name}</option>
                {/foreach}
            </select>
            <span class="fi-help-text error"></span>
        </div>
    </div>

    <div class="formitems inline">
        <label class="fi-name"><span class="colorRed">*</span>联系人：</label>
        <div class="form-controls">
            <input type="text" placeholder="" class="xlarge" name="linkman" id="linkman"
                   value="{$info.linkman}">
            <span class="fi-help-text hide"></span>
        </div>
    </div>

    <div class="formitems inline">
        <label class="fi-name"><span class="colorRed">*</span>联系方式：</label>
        <div class="form-controls">
            <input type="text" placeholder="" class="xlarge" name="link_way" id="link_way"
                   value="{$info.link_way}">
            <span class="fi-help-text hide"></span>
        </div>
    </div>

	{if $opt == 'park_contract' }
	<!--园区房源信息-->
	<div class="formitems inline clearfix park-house-wrap">
		<label class="fi-name fl"><span class="colorRed">*</span>房源信息：</label>
		<div class="house-info-wrap fl park-info-wrap">
			<!--循环添加-->
			{if $act == 'add'}
			<div class="house-info park-house-info">
				<h6 class="house-title">房源1</h6>
				<ul class="park-mid clearfix">
					<li class="mid-list fl">
						<label class="list-label fl park-name-label">
							<span class="colorRed fl">*</span>
							<span class="fl">园区名</span>
						</label>
						<select class="park-name fl house-select incubator" name="incubator_id[]">
							<option value="">--请选择--</option>
							{foreach from = $incubator_park_list item = park}
							<option value="{$park.incubator_id}">{$park.incubator_name}</option>
							{/foreach}
						</select>
					</li>
					<li class="mid-list fl mg-list">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">楼层</span>
						</label>
						<select class="park-floor fl house-select storey" name="storey_id[]">
							<option value="">--请选择--</option>
						</select>
					</li>
					<li class="mid-list fl">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">房间</span>
						</label>
						<select class="park-room fl house-select station house-room" name="station_type_id[]">
							<option value="">--请选择--</option>
						</select>
					</li>
				</ul>
				<ul class="park-bot clearfix">
					<li class="mid-list fl mg-right">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">租赁面积</span>
						</label>
						<input type="text" name="area[]" class="house-area fl" readonly="readonly" />
					</li>
					<li class="mid-list fl">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">租赁单价</span>
						</label>
						<input type="text" name="unit_price[]" class="house-price fl"  readonly="readonly" />
					</li>
				</ul>
				<span class="house-del" onclick="delParkHouse(this);">删除</span>
			</div>
			{else}
				{foreach from=$house_info key=k item=v}
				<div class="house-info park-house-info">
					<h6 class="house-title">房源{$k+1}</h6>
					<ul class="park-mid clearfix">
						<li class="mid-list fl">
							<label class="list-label fl park-name-label">
								<span class="colorRed fl">*</span>
								<span class="fl">园区名</span>
							</label>
							<select class="park-name fl house-select incubator" name="incubator_id[]">
								<option value="">--请选择--</option>
								{foreach from = $incubator_park_list item = park}
								<option value="{$park.incubator_id}" {if $v.incubator_id == $park.incubator_id}selected{/if}>{$park.incubator_name}</option>
								{/foreach}
							</select>
						</li>
						<li class="mid-list fl mg-list">
							<label class="list-label fl">
								<span class="colorRed fl">*</span>
								<span class="fl">楼层</span>
							</label>
							<select class="park-floor fl house-select storey" name="storey_id[]">
								<option value="">--请选择--</option>
								{foreach from=$v.storey_list item=storey}
								<option value="{$storey.storey_id}" {if $v.storey_id == $storey.storey_id}selected{/if}>{$storey.storey_name}</option>
								{/foreach}
							</select>
						</li>
						<li class="mid-list fl">
							<label class="list-label fl">
								<span class="colorRed fl">*</span>
								<span class="fl">房间</span>
							</label>
							<select class="park-room fl house-select station house-room" name="station_type_id[]">
								<option value="">--请选择--</option>
								{foreach from=$v.station_list item=station}
								<option value="{$station.station_type_id}" {if $v.station_type_id == $station.station_type_id}selected{/if} data-area='{$station.covered_area}' data-price='{$station.price}'>{$station.station_type_name}</option>
								{/foreach}
							</select>
						</li>
					</ul>
					<ul class="park-bot clearfix">
						<li class="mid-list fl mg-right">
							<label class="list-label fl">
								<span class="colorRed fl">*</span>
								<span class="fl">租赁面积</span>
							</label>
							<input type="text" name="area[]" class="house-area fl" readonly="readonly" value="{$v.area}" />
						</li>
						<li class="mid-list fl">
							<label class="list-label fl">
								<span class="colorRed fl">*</span>
								<span class="fl">租赁单价</span>
							</label>
							<input type="text" name="unit_price[]" class="house-price fl"  readonly="readonly" value="{$v.unit_price}" />
						</li>
					</ul>
					<span class="house-del" onclick="delParkHouse(this);">删除</span>
				</div>
				{/foreach}
			{/if}
		</div>
	</div>
	{/if}

	{if $opt == 'zhongchuang_contract'}
	<!--众创空间房源信息-->
	<div class="formitems inline clearfix zhongc-house-wrap">
		<label class="fi-name fl"><span class="colorRed">*</span>房源信息：</label>
		<div class="house-info-wrap fl zhongc-info-wrap">
			<!--循环添加-->
			{if $act == 'add'}
			<div class="house-info zhongc-house-info">
				<h6 class="house-title">房源1</h6>
				<ul class="zhongc-mid clearfix">
					<li class="mid-list fl">
						<label class="list-label fl zhongc-name-label">
							<span class="colorRed fl">*</span>
							<span class="fl">众创空间名</span>
						</label>
						<select class="zhongc-name fl house-select incubator clear_no" name="incubator_id[]">
							<option value="">--请选择--</option>
							{foreach from =$incubator_zhongc_list item =zhongc}
							<option value="{$zhongc.incubator_id}">{$zhongc.incubator_name}</option>
							{/foreach}
						</select>
					</li>
					<li class="mid-list fl" style="margin:0 10px;">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">楼层</span>
						</label>
						<select class="zhongc-floor fl house-select storey clear_no" name="storey_id[]">
							<option value="0">--请选择--</option>
						</select>
					</li>
					<li class="mid-list fl">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">工位类型</span>
						</label>
						<select class="station-type fl house-select station house-station clear_no" name="station_class[]">
							<option value="0">--请选择--</option>
						</select>
						
					</li>
				</ul>
				<ul class="park-bot clearfix">
					<li class="mid-list fl mg-right">
						<label class="list-label fl" style="padding-left:28px;">
							<span class="colorRed fl">*</span>
							<span class="fl">工位号</span>
						</label>
						<select class="station-num fl house-select station_num">
							<option value="0">--请选择--</option>
						</select>
						<input type="hidden" name='station_ids[]'>
					</li>
				</ul>
				<ul class="show-station clearfix">
					<!-- <li class="fl">工位1</li>
					<li class="fl">工位2</li> -->
				</ul>
				<span class="house-del" onclick="delZhongcHouse(this);">删除</span>
			</div>
			{else}
				{foreach from=$house_info item=v key=k}
				<div class="house-info zhongc-house-info">
					<h6 class="house-title">房源{$k+1}</h6>
					<ul class="zhongc-mid clearfix">
						<li class="mid-list fl">
							<label class="list-label fl zhongc-name-label">
								<span class="colorRed fl">*</span>
								<span class="fl">众创空间名</span>
							</label>
							<select class="zhongc-name fl house-select incubator clear_no" name="incubator_id[]">
								<option value="">--请选择--</option>
								{foreach from =$incubator_zhongc_list item =zhongc}
								<option value="{$zhongc.incubator_id}" {if $v.incubator_id == $zhongc.incubator_id}selected{/if}>{$zhongc.incubator_name}</option>
								{/foreach}
							</select>
						</li>
						<li class="mid-list fl" style="margin:0 10px;">
							<label class="list-label fl">
								<span class="colorRed fl">*</span>
								<span class="fl">楼层</span>
							</label>
							<select class="zhongc-floor fl house-select storey clear_no" name="storey_id[]">
								<option value="0">--请选择--</option>
								{foreach from=$v.storey_list item=storey}
								<option value="{$storey.storey_id}" {if $v.storey_id == $storey.storey_id}selected{/if}>{$storey.storey_name}</option>
								{/foreach}
							</select>
						</li>
						<li class="mid-list fl">
							<label class="list-label fl">
								<span class="colorRed fl">*</span>
								<span class="fl">工位类型</span>
							</label>
							<select class="station-type fl house-select station house-station clear_no" name="station_class[]">
								<option value="0">--请选择--</option>
								{foreach from=$v.station_class item=class}
								<option value="{$class.station_class_id}" {if $v.station_class_id == $class.station_class_id}selected{/if}>{$class.class_name}</option>
								{/foreach}
							</select>
							
						</li>
					</ul>
					<ul class="park-bot clearfix">
						<li class="mid-list fl mg-right">
							<label class="list-label fl" style="padding-left:28px;">
								<span class="colorRed fl">*</span>
								<span class="fl">工位号</span>
							</label>
							<select class="station-num fl house-select station_num">
								<option value="0">--请选择--</option>
								{foreach from=$v.all_station_list item=station}
								<option value="{$station.station_type_id}" {if in_array($station.station_type_id, $v.station_ids)}disabled="true"{/if}>{$station.station_num}</option>
								{/foreach}
							</select>
							<input type="hidden" name='station_ids[]' value="{implode(',', $v.station_ids)}">
						</li>
					</ul>
					<ul class="show-station clearfix">
						{foreach from=$v.station_list item=station}
						<li class="fl" data-price="{$station.price}" data-station_id="{$station.station_type_id}">{$station.station_num}</li>
						{/foreach}
					</ul>
					<span class="house-del" onclick="delZhongcHouse(this);">删除</span>
				</div>
				{/foreach}
			{/if}
		</div>
	</div>
	{/if}
	
	
	
	
    <div id="add_below" class="formactions mgl180">
    	<!--增加园区房源-->
		{if $opt == 'park_contract'}
        <a href="javascript:;" onclick="addParkHouse();" class="btn btn-blue"><i class="gicon-plus white"></i>增加房源</a>
		{/if}
        <!--增加众创空间房源-->
		{if $opt == 'zhongchuang_contract'}
        <a href="javascript:;" onclick="addZhongcHouse();" class="btn btn-blue"><i class="gicon-plus white"></i>增加房源</a>
		{/if}
    </div>
	
	<!--选择租赁时间-->
	<div class="lease-wrap clearfix">
        <ul class="lease-list clearfix">
        	<li class="fl">
        		<label class="list-label fl">
					<span class="colorRed fl">*</span>
					<span class="fl">选择租赁时间</span>
				</label>
				{if $opt == 'park_contract'}
				<!--园区租赁时间-->
				<select class="lease-year fl" name='lease_year' >
					<option value="">--请选择租赁时间--</option>
					<option value="0" {if $info.lease_time == 1}selected{/if}>一年</option>
					<option value="1" {if $info.lease_time == 2}selected{/if}>二年</option>
					<option value="2" {if $info.lease_time == 3}selected{/if}>三年</option>
					<option value="3" {if $info.lease_time == 4}selected{/if}>四年</option>
				</select>
				{/if}

				{if $opt == 'zhongchuang_contract'}
				<!--众创空间租赁时间-->
				<input type="text" name='lease_day' class="fl lease-inp" value="{$info.lease_time}" />
				<span class="fl" style="line-height:25px;margin-left:5px;">天</span>
				<input type="hidden" name='station_ids_str'>
				{/if}
        	</li>
        	<li class="fl lease-total-price">
        		<label class="list-label fl">
					<span class="colorRed fl">*</span>
					<span class="fl">租赁总金额</span>
				</label>
				<input type="text" class="fl lease-inp" name='lease_total_money' readonly="readonly" value="{$info.lease_total_money}" />
        	</li>
        </ul>
        <ul class="lease-list clearfix">
        	<li class="fl lcash-pledge">
        		<label class="list-label fl">
					<span class="colorRed fl">*</span>
					<span class="fl">押金</span>
				</label>
				<input type="text" class="fl lease-inp" name='deposit'  value="{$info.deposit}" />
        	</li>
        	<li class="fl service-total-price">
        		<label class="list-label fl">
					<span class="colorRed fl">*</span>
					<span class="fl">技术咨询总服务费</span>
				</label>
				<input type="text" class="fl lease-inp" name='consult_total_money'  value="{$info.consult_total_money}" />
        	</li>
        </ul>
        <ul class="lease-list clearfix">
        	<li class="fl lease-start-time">
        		<label class="list-label fl">
					<span class="colorRed fl">*</span>
					<span class="fl">开始时间</span>
				</label>
				<input type="text" class="fl lease-inp Wdate" name='start_time' autocomplete="off" onclick="WdatePicker({ dateFmt:'yyyy-MM-dd'})" value="{if $info.start_time}{date('Y-m-d', $info.start_time)}{/if}" />
        	</li>
        </ul>
    </div>

	{if $opt == 'park_contract'}
	<!--园区每年租赁金额-->
	<div class="lease-price-wrap clearfix">
		<span class="left-word fl">每年租赁金额</span>
		<ul class="fl lease-price-ul">
			{if $act == 'edit'}
			{foreach from=$lease_info item=v key=k}
			<li class="lease-price clearfix">
				<div class="fl lease-val-box">
					<span class="fl lease-span">第{$k}年租金</span>
					<input type="text" class="lease-val fl" value="{$v.lease_money}" />
				</div>
				<div class="fl">
					<span class="fl">技术咨询服务费</span>
					<input type="text" class="service-val fl" value="{$v.consult_money}" />
				</div>
			</li>
			{/foreach}
			{/if}
			<!-- <li class="lease-price clearfix">
				<div class="fl lease-val-box">
					<span class="fl lease-span">第一年租金</span>
					<input type="text" class="lease-val fl" />
				</div>
				<div class="fl">
					<span class="fl">技术咨询服务费</span>
					<input type="text" class="service-val fl" />
				</div>
			</li> -->
		</ul>
	</div>
	{/if}

	<!--上传附件-->
	<div class="upload-file-wrap clearfix">
		<button class="upload-file-btn fl" id="upload-file-btn">上传附件</button>
		<input type="hidden" value="{$file_val}" id="file-inp" name='files' />

		<div class="upload-file fl">
			{foreach from=$files item=v}
			<div class="file-box fl">
				<input type="hidden" class="file_url" value="{$v}">
				<img src="/Public/Images/front/front_img/word.png" />
				<span class="del-file"></span>
			</div>
			{/foreach}
			
		</div>

	</div>
	
	
    <div class="formitems inline">
        <label class="fi-name"></label>
        <div class="form-controls">
        	
            <input type="hidden" name="act" value="{$act}"/>
            <input type="hidden" name="contract_id" value="{$contract_id}"/>
            <button type="submit" class="btn btn-blue"><i class="gicon-check white"></i>保存</button>
        </div>
    </div>
</form>

{if $opt == 'zhongchuang_contract'}
<div style="display:none;" class='clone_zc'>
	<div class="house-info zhongc-house-info" >
				<h6 class="house-title">房源1</h6>
				<ul class="zhongc-mid clearfix">
					<li class="mid-list fl">
						<label class="list-label fl zhongc-name-label">
							<span class="colorRed fl">*</span>
							<span class="fl">众创空间名</span>
						</label>
						<select class="zhongc-name fl house-select incubator clear_no" name="incubator_id[]">
							<option value="">--请选择--</option>
							{foreach from =$incubator_zhongc_list item =zhongc}
							<option value="{$zhongc.incubator_id}">{$zhongc.incubator_name}</option>
							{/foreach}
						</select>
					</li>
					<li class="mid-list fl" style="margin:0 10px;">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">楼层</span>
						</label>
						<select class="zhongc-floor fl house-select storey clear_no" name="storey_id[]">
							<option value="0">--请选择--</option>
						</select>
					</li>
					<li class="mid-list fl">
						<label class="list-label fl">
							<span class="colorRed fl">*</span>
							<span class="fl">工位类型</span>
						</label>
						<select class="station-type fl house-select station house-station clear_no" name="station_class[]">
							<option value="0">--请选择--</option>
						</select>
					</li>
				</ul>
				<ul class="park-bot clearfix">
					<li class="mid-list fl mg-right">
						<label class="list-label fl" style="padding-left:28px;">
							<span class="colorRed fl">*</span>
							<span class="fl">工位号</span>
						</label>
						<select class="station-num fl house-select station_num">
							<option value="0">--请选择--</option>
						</select>
						<input type="hidden" name='station_ids[]'>
					</li>
				</ul>
				<ul class="show-station clearfix">
				</ul>
				<span class="house-del" onclick="delZhongcHouse(this);">删除</span>
			</div>
</div>
{/if}
{/block}
{block name="js"}
<script src="__JS__/front/layer.m.js?version={$version}"></script>
<script type="text/javascript" src="/Public/Js/front/front_js/ajaxupload.3.5.js"></script>
<script src="/Public/Js/acp/AcpContract/add_housing.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/Plugins/My97DatePicker/WdatePicker.js?version={$version}"></script>
<script>
	var opt = '{$opt}';
</script>
{/block}
